#include <stdio.h>
#include <unistd.h>

int main()
{
  printf("this is a main pid=%d, ppid=%d\n", getpid(), getppid());
  // sleep(5);
  int pidOne = fork();
  // 等于 0 则不是新进程
  if (pidOne == 0)
  {
    printf("pidOne %d\n", getppid());
    sleep(3);
  }
  else
  {
    printf("main %d\n", getpid());
  }
  printf("main== %d\n", getpid());
  // sleep(10);
  int pidTwo = fork();
  if (pidTwo == 0)
  {
    printf("pidTwo %d\n", getpid());
  }
  return 0;
}
